Skip to content

Conversation

etpinard
Copy link
Contributor

fixes https://github.com/plotly/streambed/issues/9172

In a few cases, given:

Plotly.relayout(gd, updateObj)

// or
Plotly.update(gd, {}, updateObj)

the input updateObj is mutated by the relayout logic while converting aliases for example here when relayout'ing annotations.

This bug became very problematic for update menu buttons relayout annotations (example) where it caused the buttons to stop working after repeated clicks.

Note that, the restyle object - i.e. as in Plotly.restyle(gd, restyleObject, traces) - are never mutated. In this PR, I chose to extend them anyway in case we do start mutating them down the road.

- so that if key-vals need to be mapped
  (this happens for annotations relayout calls), the input
  object doesn't get mutated.
@etpinard etpinard added status: reviewable bug something broken labels Feb 13, 2017
@alexcjohnson
Copy link
Collaborator

Good call 💃

@etpinard etpinard merged commit 190b3b5 into master Feb 15, 2017
@etpinard etpinard deleted the relayout-annotations-mutation-guard branch February 15, 2017 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants